﻿<?php
//读文件

$file=fopen("chatLog.json","r+") or exit("Unable to open file!");
/*while (!feof($file)){
    //输出响应
    echo fgets($file);
    echo $file;
}*/
clearstatcache();
$fp = filesize("chatLog.json")-2;
$text = ",{\"name\":\"测试人员-".$fp."\",\"text\":\"大大大大后天\"}]}";
fseek($file,$fp);
fwrite($file,$text);
//echo fgetc($file);
fclose($file);
?>